﻿Ext.onReady(function () {
    Ext.apply(Kwan, {
        def: Customer
    });
});
Ext.apply(Kwan, {
    isCheckIN: function (d) {
        var template = '<span style="color:{0};">{1}</span>', color, tips;
        if (d === 0) { color = 'blue', tips = '未入住'; } else { color = 'red', tips = '入住中'; }
        return String.format(template, color, tips);
    },
    Sex: function (d) {
        return d === 1 ? "男" : "女";
    },
    search: function (i) {
        var cName = i === 0 ? '' : txtSearch.getValue(),
            filter = btnIsCheckIN.pressed ? cName + ',0' : cName + ',';
        txtFilter.setValue(filter);
    }
});